perm filename HMWK5.106[1,RWF] blob
sn#541596 filedate 1980-10-17 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 CS106
C00004 ENDMK
Cā;
CS106
Fall Quarter Oct. 16, 1980
Assignment 5
Due date: Oct. 24
Write a program which reads an integer N , followed by N lines
of data. Each line contains the dimensions A, B, C, D of two rectangles.
Your program should test whether an A x B rectangle can fit inside a
C x D rectangle, or vice versa. For each pair of rectangles, it should
(after echoing input) say which (if any) fits inside the other, and whether
horizontally or diagonally.
Hint: Imagine the rectangles placed with a common center; one stays
horizontal, the other rotates. Suppose its corners hit the stationary
rectangle at points E, F, G, H on the diagram. Then it can fit inside the
larger rectangle only diagonally; if it does, it fits inside the rectangle
EFGH (with its sides parallel to EFGH).
Input data are on file CS:HMWK5.DAT